local reporter = {}

local json = require "cjson"

function reporter.new(_logger)
    return setmetatable({ logger = _logger }, { __index = reporter })
end

function reporter:boot(...)
end

function reporter:send(reporter_spans)
    if not reporter_spans then
        self.logger.error("reporter_spans is null")
        return
    end
    local segmentJson, err = json.encode(reporter_spans)

    if not segmentJson then
        self.logger.error("failed to encode segment: " .. tostring(err))
        return
    end

    self.logger.info('log_reporter_segmentJson = '.. tostring(segmentJson))
end

return reporter